//
//  PaymentViewController.swift
//  MD5
//
//  Created by 郑东喜 on 2016/11/24.
//  Copyright © 2016年 郑东喜. All rights reserved.
//

import UIKit

class PaymentViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

    self.navigationItem.title = "充值"
        
        //样式：组
        tableView = UITableView(frame: view.bounds, style: .grouped)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

// MARK:- 表格头
extension PaymentViewController {
    
    //头视图
    override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        return PaymentHeader()
    }
    
    //表格头视图高度
    override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {

        return 200
    }
}


// MARK: - Table view data source
extension PaymentViewController {
    
    
    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 1
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        var cell = UITableViewCell(style: .default, reuseIdentifier: "cellID") as? PaymentCell
        if cell == nil {
            cell = PaymentCell(style: .default, reuseIdentifier: "cellID")
        }
        
        return cell!
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 10
    }
    
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 60
    }
    

}
